using System.Collections;
using Microsoft.AspNetCore.Mvc;

namespace SwaggerTest.Controllers;

/// <summary>
/// 职员控制器
/// </summary>
[ApiController]
[Route("api/[controller]")]
[ApiExplorerSettings(GroupName = "职工系统")]
public class StaffController : ControllerBase
{
    private readonly ILogger<WeatherForecastController> _logger;

    public StaffController(ILogger<WeatherForecastController> logger)
    {
        _logger = logger;
    }

    private static readonly string[] Staff =
    [
        "张三", "里斯", "王五"
    ];
    
    /// <summary>
    /// 获取全部职员信息
    /// </summary>
    /// <returns></returns>
    [HttpGet(Name = "GetStaffs")]
    public IEnumerable Get()
    {
        return Staff.Select((m, index) => new
        {
            id = index,
            name = m.ToString(),
            remark = "<UNK>"
        }).ToList();
    }
}